#ifndef GF_TYPES_H
#define GF_TYPES_H

#include "main.h"

// Define structs for vectors and matrices.  These contain the array pointers
// and the array dimensions.  Note that ragged arrays are not allowed in this 
// form.

typedef struct {
    int * data;
    unsigned long len;
} Vector;

typedef struct {
    int ** data;
    unsigned long rows;
    unsigned long cols;
} Matrix;

/* Declare functions for allocating and clearing Vector and Matrix types */

// Allocate a vector array (for polyDiv)
Vector** allocate_vector_array(unsigned long len1, unsigned long len2);

// Allocate a vector of ints, with length len
Vector * allocate_vector(unsigned long len);

// Free a vector
void free_vector(Vector *V);

// Create a copy of a vector
Vector * copy_vector(Vector *V);

// Compare two vectors for equality
int compare_vectors(Vector *V, Vector *W);

// Print a vector to stdout
void print_vector(Vector *V);

// Concatenate two vectors
Vector * vector_cat(Vector * U, Vector * V);

// Allocate a matrix of ints, with dimensions specified by rows and cols
Matrix * allocate_matrix(unsigned long rows, unsigned long cols);

// Free a matrix
void free_matrix(Matrix *M);

// Print a matrix
void print_matrix(Matrix *M);

#endif
